declare let AMap: any
type Map = any

type GdMapFun = any
export const gdMapFun={
    //初始化地图
   InitMap : (id = 'Container') => {
        let map: any = ''
        map = new AMap.Map(id, {
            zoom: 13,
            rotateEnable: true,
            pitchEnable: true,
            pitch: 0,
            defaultCursor: 'Pointer',
            showBuildingBlock: false,
            buildingAnimation: true,
            expandZoomRange: true,
            zooms: [0, 20],
            resizeEnable: true,
            features: ['point', 'road', 'bg'],
            viewMode: '3D',
            cursor: 'move'
        })
        map.setFitView()
        return map
    },
    // 修改地图皮肤
   setMapStyle:(map: Map, value: string) => {
        const myStyle = 'amap://styles/' + value
        map.setMapStyle(myStyle)
    },
    // 设置中心点
   setZoomCentrer: (map: Map, index: number, position: number[]) => {
        map.setZoomAndCenter(index, position)
    },
}
